package com.lkc.enums;

public enum AppHttpCodeEnum {
    // 成功
    SUCCESS(200, "操作成功"),
    // 登录注册相关，code范围为510-529
    NEED_LOGIN(510, "需要登录后操作"),
    NO_OPERATOR_AUTH(511, "无权限操作"),
    SYSTEM_ERROR(512, "出现错误"),
    USERNAME_EXIST(513, "用户名已存在"),
    NICKNAME_EXIST(514, "昵称已存在"),
    LOGIN_TIMEOUT(515, "登录超时"),
    PHONE_NUMBER_EXIST(516, "手机号已存在"),
    EMAIL_EXIST(517, "邮箱已存在"),
    REQUIRE_USERNAME(518, "必需填写用户名"),
    REQUIRE_PASSWORD(519, "必需填写密码"),
    LOGIN_ERROR(520, "用户名或密码错误"),
    CONTENT_NOT_NULL(521, "内容不为空"),
    EMAIL_NOT_NULL(522, "必须填写邮箱"),
    NICKNAME_NOT_NULL(523, "必须填写昵称"),
    LOGIN_ILLEGAL(524, "登录非法"),
    //文件相关
    FILE_TYPE_ERROR(521, "上传文件格式错误，只能是JPG、GIF或者PNG格式"),


    //增删改查
    MODIFY_ERROR(570, "修改失败"),
    DELETE_ERROR(571, "删除失败"),
    SAVE_SUCCESS(200, "添加成功"),
    SAVE_ERROR(572, "添加失败"),
    MODIFY_SUCCESS(200, "修改成功"),
    DELETE_SUCCESS(200, "删除成功");

    int code;
    String msg;

    AppHttpCodeEnum(int code, String errorMessage) {
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}